<!--
 * @Author: weidewei
 * @Date: 2025-05-21 13:45:31
 * @LastEditors: weidewei
 * @LastEditTime: 2025-05-21 14:59:46
 * @Description: 
 * @FilePath: \v3\src\views\home\components\TestEventBus.vue
-->
<template>
    <div>
        <h2>TestEventBus</h2>
        <h2><slot></slot></h2>
        <button @click="handleEventBus">eventsBus测试</button>
    </div>
</template>
<script lang="ts" setup>
import { getCurrentInstance,onMounted  } from "vue";
const { proxy } = getCurrentInstance()!
// onMounted(() => {
//   console.log(proxy.$bus)
// });

function handleEventBus() {
  proxy.$bus.emit('eventBus',{
    name: '张三',
    age: 20
  })  
}
</script>